﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RuleOfReady.Core.DomainModels.Tiles;

namespace RuleOfReady.Core.DomainModels.Sets
{
    /// <summary>
    /// Object that represents a Quad (Chinese: Kong, Japanese: Kantsu)
    /// This is a set of 4 identical tiles (this is still a set, a player
    /// makes this by calling 'kan', and drawing a Replacement Tile from the
    /// Dead Wall (to still be ablt to make a hand with the standard form)
    /// </summary>
    public class MahjongQuad : MahjongPossibleSet
    {

        #region Public Properties (read-only)

        /// <summary>
        /// (MahjongPossibleSet) Tiles of the Quad
        /// </summary>
        public override IEnumerable<MahjongTile> Tiles { get; protected set; }

        /// <summary>
        /// (MahjongPossibleSet) Waiting tiles for a Quad (none)
        /// </summary>
        public override IEnumerable<MahjongTile> WaitingTiles { get; protected set; }

        /// <summary>
        /// (MahjongPossibleSet) FLAG: Is this a complete set (true)
        /// </summary>
        public override bool CompletedSet { get; protected set; }

        #endregion

        #region Constructor

        /// <summary>
        /// Create a new Mahjong Quad of the given Tile
        /// </summary>
        /// <param name="tile">Mahjong Tile that makes up the quad</param>
        public MahjongQuad(MahjongTile tile)
        {
            this.Tiles = Enumerable.Repeat(tile, 4);
            this.WaitingTiles = new List<MahjongTile>();
            this.CompletedSet = true;
        }

        #endregion

        #region Public Methods

        /// <summary>
        /// (MahjongPossibleSet) Add a tile to this Quad to make a new set (always returns null)
        /// </summary>
        /// <param name="addTile">tile to add</param>
        /// <returns>Always returns null (can't add a tile to a quad)</returns>
        public override MahjongPossibleSet Add(MahjongTile addTile)
        {
            return null;
        }

        #endregion
    }
}
